package org.circedroid.core;

public class PRC{
	private int mode;
	private int elg;
	private double X0;
	private double Y0;
	private int lgo;
	private int unit_angle;
	private double l0;
	private double j0;
	private double delta;
	private double j1;
	private double j2;
	private int c;
	private int type;
	private String nom;
	public PRC(int mode, int elg, double X0, double Y0, int lgo, int unit_angle, double l0, double j0, double delta, double j1, double j2, int c, int type, String nom){
		this.mode=mode;
		this.elg=elg;
		this.lgo=lgo;
		this.c=c;
		this.X0=X0;
		this.Y0=Y0;
		this.unit_angle=unit_angle;
		this.l0=l0;
		this.j0=j0;
		this.delta=delta;
		this.j1=j1;
		this.j2=j2;
		this.type=type;
		this.nom=nom;
	}
	public int getMode(){return this.mode;}
	public int getELG(){return this.elg;}
	public double getX0(){return this.X0;}
	public double getY0(){return this.Y0;}
	public int getUnitAngle(){return this.unit_angle;}
	public double getL0(){

		double retour=0;
		double value=this.l0;
		switch (this.unit_angle) {
		case 2:
			retour=value*Math.PI/180.0;
			break;
		case 3:
			retour=value*Math.PI/200.0;
			break;
		case 10:
			long deg;
			long min;
			double sec;
			deg=(long)value;
			min=(long)((value-(double)deg)*100.0);
			sec=((value-(double)deg)*100.0-(double)min)*100.0;
			if (sec>60){
				sec=0;
				min++;
			}
			retour=(double)deg+(double)min/60.0+sec/3600.0;
			retour=retour*Math.PI/180.0;
			break;
		}
		return retour;
	}
	public double getJ0(){
		double retour=0;
		double value=this.j0;
		switch (this.unit_angle) {
		case 2:
			retour=value*Math.PI/180.0;
			break;
		case 3:
			retour=value*Math.PI/200.0;
			break;
		case 10:
			long deg;
			long min;
			double sec;
			deg=(long)value;
			min=(long)((value-(double)deg)*100.0);
			sec=((value-(double)deg)*100.0-(double)min)*100.0;
			if (sec>60){
				sec=0;
				min++;
			}
			retour=(double)deg+(double)min/60.0+sec/3600.0;
			retour=retour*Math.PI/180.0;
			break;
		}
		return retour;
	}
	public double getDelta(){return this.delta;}
	public double getJ1(){
		double retour=0;
		double value=this.j1;
		switch (this.unit_angle) {
		case 2:
			retour=value*Math.PI/180.0;
			break;
		case 3:
			retour=value*Math.PI/200.0;
			break;
		case 10:
			long deg;
			long min;
			double sec;
			deg=(long)value;
			min=(long)((value-(double)deg)*100.0);
			sec=((value-(double)deg)*100.0-(double)min)*100.0;
			if (sec>60){
				sec=0;
				min++;
			}
			retour=(double)deg+(double)min/60.0+sec/3600.0;
			retour=retour*Math.PI/180.0;
		}
		return retour;
	}
	public double getJ2(){
		double retour=0;
		double value=this.j2;
		switch (this.unit_angle) {
		case 2:
			retour=value*Math.PI/180.0;
			break;
		case 3:
			retour=value*Math.PI/200.0;
			break;
		case 10:
			long deg;
			long min;
			double sec;
			deg=(long)value;
			min=(long)((value-(double)deg)*100.0);
			sec=((value-(double)deg)*100.0-(double)min)*100.0;
			if (sec>60){
				sec=0;
				min++;
			}
			retour=(double)deg+(double)min/60.0+sec/3600.0;
			retour=retour*Math.PI/180.0;
		}
		return retour;
	}
	public int getType(){return this.type;}
	public String getNom(){return this.nom;}
	public int getLGO(){return this.lgo;}
}